// 一个 *：匹配当前目录下的文件
// 两个 *：匹配当前目录及其嵌套的全部子目录下的文件
// const requireComponent = import.meta.globEager('./library/*.vue')
//函数
import * as func from "@/views/Amobile/components/function/index";
// import * as custom from "@/views/components/function/custom";
//组件
const requireComponent = import.meta.globEager("./**/*.vue");
export default {
  install(Vue) {
    // Object.keys(custom).forEach((item) => {
    //   Vue.config.globalProperties["$" + item] = custom[item];
    // });
    Object.keys(func).forEach((item) => {
      Vue.config.globalProperties["$" + item] = func[item];
    });
    Object.keys(requireComponent).forEach((item) => {
      const defaultObj = requireComponent[item].default;
      Vue.component(defaultObj.name, defaultObj);
    });
  },
};
